import {
  QUERYFIELDS,
  ADDFIELDS,
  DELETEFIELDS,
  UPDATEFIELDS,
  QUERYPARENTNODE,
  FORMWORKADD,
  FORMWORKSUBMIT,
  FORMWORKEDIT,
  FORMWORKDETAIL,
  FORMWORKUPDATE,
  BUSINESSWORKLIST,
  BUSINESSWORKSUB,
  WORKFINDBYBID,
  GENURLBYNAME,
  FINDFORMBYCODENO,
  GETOPTIONRECORD,
  EXPORTEXCEL
} from "./formApi";
import { METHOD, request } from "@/utils/request";

export async function queryFields(params) {
  return request(QUERYFIELDS, METHOD.POST, params);
}

export async function addFields(params) {
  return request(ADDFIELDS, METHOD.POST, params);
}

export async function updateFields(params) {
  return request(UPDATEFIELDS, METHOD.POST, params);
}

export async function deleteFields(params) {
  return request(DELETEFIELDS, METHOD.POST, params);
}

export async function queryParentNode(params) {
  return request(QUERYPARENTNODE, METHOD.GET, params);
}

export async function formWorkDetail(params) {
  return request(FORMWORKDETAIL, METHOD.GET, params);
}

export async function formWorkAdd(params) {
  return request(FORMWORKADD, METHOD.POST, params);
}

export async function formWorkSubmit(params) {
  return request(FORMWORKSUBMIT, METHOD.POST, params);
}

export async function formWorkEdit(params) {
  return request(FORMWORKEDIT, METHOD.POST, params);
}

export async function formWorkUpdate(params) {
  return request(FORMWORKUPDATE, METHOD.POST, params);
}

export async function businessWorkList() {
  return request(BUSINESSWORKLIST, METHOD.GET, {});
}

export async function businessWorkSub(params) {
  return request(BUSINESSWORKSUB, METHOD.GET, params);
}

export async function workFindByBid(params) {
  return request(WORKFINDBYBID, METHOD.GET, params);
}

export async function genUrlByName(params) {
  return request(GENURLBYNAME, METHOD.GET, params);
}

export async function findByCodeNo(params) {
  return request(FINDFORMBYCODENO, METHOD.GET, params);
}

export async function getLogData(params) {
  return request(GETOPTIONRECORD, METHOD.GET, params);
}

export async function exportExcel(params) {
  return request(EXPORTEXCEL, METHOD.POST, params, { responseType: 'blob' });
}
